package com.ctgu.rabbitmq.rabbitmq.exchange.alternateExchange;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @ ClassName AlternateExchangeConsumer
 * @ Author Alex2
 * @ Date 2025/8/18 8:50
 **/
@Log4j2
@Component
public class AlternateExchangeConsumer {
    private static final String TAG = "Alex";

    @RabbitListener(queues = AlternateExchangeConfig.MAIN_QUEUE)
    public void mainQueueMessage(String message) {
        log.debug("{} : main queue 收到消息 : {}", TAG, message);
    }

    // 备用队列
    @RabbitListener(queues = AlternateExchangeConfig.ALTERNATE_QUEUE)
    public void alternateQueueMessage(String message) {
        log.debug("{} : alternate queue 收到消息 : {}", TAG, message);
    }
}